package com.runa.monitor.platinterface.meter3_0.command;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

/**
 * @author diandian
 * @Date 2022/12/6 21:27
 */
public class ReqControlValve extends MeteringCommand {

    public ReqControlValve(String netEquSerialNo) {
        super("Req_Control_Valve", netEquSerialNo);
    }

    private ReqControlValve.Data data;

    public ReqControlValve.Data getData() {
        return data;
    }

    public void setData(ReqControlValve.Data data) {
        this.data = data;
    }

    @Getter
    @Setter
    public static class Data{
        @JSONField(name = "Valves")
        private List<ValvesInfo> valves;

        public List<ValvesInfo> getValves() {
            return valves;
        }

        public void setValves(List<ValvesInfo> valves) {
            this.valves = valves;
        }
    }

    @Getter
    @Setter
    public static class ValvesInfo {
        private String serialNo;
        private String controlType = "开度";
        private Boolean isLock = false;
        @JSONField(name = "OpeningDegree")
        private String openingDegree;

        public ValvesInfo() {
        }

        public ValvesInfo(String serialNo, String openingDegree) {
            this.serialNo = serialNo;
            this.openingDegree = openingDegree;
        }
    }
}